/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * resultados.java
 *
 * Created on 09-ene-2011, 12:21:46
 */

package interfaz;

import java.util.Vector;
import javax.swing.ImageIcon;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author joshi
 */
public class resultados extends javax.swing.JFrame {
    private Vector<String> tableHeaders;
    private Vector tableData;
    private Vector<Object> oneRow;

    /** Creates new form resultados */
    public resultados(Object v1, Object v2, Object v3, Object v4, Object v5) {
        initComponents();
        this.setResizable(false);
        this.setIconImage (new ImageIcon(getClass().getResource("/images/face-monkey.png")).getImage());
        this.setTitle("Resultados");
        modelo(v1,v2,v3,v4,v5);

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jButton1 = new javax.swing.JButton();

        setBounds(new java.awt.Rectangle(200, 100, 0, 0));

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/emblem-default.png"))); // NOI18N
        jButton1.setText("Aceptar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 520, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(400, Short.MAX_VALUE)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:

    
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
    * @param args the command line arguments
    */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new resultados(1,2,3.4,4,5).setVisible(true);
//            }
//        });
//    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    // End of variables declaration//GEN-END:variables

    private void modelo(Object v1, Object v2, Object v3, Object v4, Object v5) {
        tableHeaders = new Vector<String>();
        tableData = new Vector();
        tableHeaders.add("Variable");
        tableHeaders.add("Valor");
        this.jTable1.setModel(new DefaultTableModel(tableData, tableHeaders));
        oneRow = new Vector<Object>();
        oneRow.add("Personas atendidas");
        oneRow.add(v1);
        tableData.add(oneRow);
        oneRow = new Vector<Object>();
        oneRow.add("Tiempo promedio de espera en el sistema");
        oneRow.add(v2);
        tableData.add(oneRow);
        oneRow = new Vector<Object>();
        oneRow.add("Tiempo promedio de espera en la cola");
        oneRow.add(v3);
        tableData.add(oneRow);
        oneRow = new Vector<Object>();
        oneRow.add("Logitud de la cola");
        oneRow.add(v4);
        tableData.add(oneRow);
        oneRow = new Vector<Object>();
        oneRow.add("Personas en el sistema");
        oneRow.add(v5);
        tableData.add(oneRow);

    }







}
